<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>

		<meta http-equiv="Content-Type" content="text/html; charset=<?php echo Yii::app()->charset;?>" />

		<title><?php echo CHtml::encode($this->pageTitle);?></title>
		<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl;?>/resources/scripts/jquery-1.3.2.min.js"></script>
		<link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl;?>/resources/css/style_par.css" type="text/css" media="screen" />
		<script>
			function selthisUser(sId)
			{
				var Cells = $("#user"+sId).find("td");
				var userName = $(Cells[0]).html();
				if(confirm("确定要选择:"+userName+"为房间创建人吗?")){
					var t = $(window.parent.document);					
					$(t).find(".<?php echo $parentId?>").html(userName);
					$(t).find("#<?php echo $parentHiddenId?>").val(sId);
				}
			}
		</script>
	</head>
<body>
<?php
/* @var $this UserController */
/* @var $model Userinfo */

$this->breadcrumbs=array(
	'Userinfos'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Userinfo', 'url'=>array('index')),
	array('label'=>'Create Userinfo', 'url'=>array('create')),
);
?>
			<table>					
				<thead>
					<tr>
					   <th>用户名</th>
					   <th>是否在线</th>
					   <th>所在省份</th>
					   <th>所在地区</th>
					   <th>用户状态</th>
					   <th>创建时间</th>
					   <th></th>
					</tr>
				</thead>
				<tbody>
						<tr id="user0">
							<td>系统用户</td>
							<td>在线</td>
							<td>浙江</td>
							<td>杭州</td>
							<td>正常</td>
							<td><?php echo date("Y-m-d H:i");?></td>
							<td><?php echo CHtml::link("选择","javascript:selthisUser(0);");?></td>
						</tr>
						<?php if(isset($users) && $users!=""):?>							
								<?php foreach($users as $user):?>
									<tr id="user<?php echo CHtml::encode($user["Id"]);?>">
										<td><?php echo CHtml::encode($user["UserName"]);?></td>
										<td><?php echo ($user["UserIsOnline"]==0)?"离线":"在线";?></td>
										<td><?php echo CHtml::encode($user["UserProvince"]);?></td>
										<td><?php echo CHtml::encode($user["UserArea"]);?></td>
										<td><?php echo ($user["CheckFlag"]==1)?"正常":"异常";?></td>
										<td><?php echo isset($user["Created"])?date("Y-m-d H:i",$user["Created"]):date("Y-m-d H:i");?></td>
										<td><?php echo CHtml::link("选择","javascript:selthisUser(".CHtml::encode($user["Id"]).");");?></td>
									</tr>
								<?php endforeach;?>
						<?php endif;?>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="9">
							<div class="clear"></div>
							<?php if(isset($pages)):?>
							<div class="pagination">
							<?php $this->widget("CLinkPager",array(
										"pages"=>$pages,
										"cssFile"=>Yii::app()->theme->baseUrl."/resources/css/style.css",
										"header"=>"",
									))?>
							<?php endif;?>
							</div> <!-- End .pagination -->
							<div class="clear"></div>
						</td>
					</tr>
				</tfoot>
			</table>
</body>
</html>